package com.wealth.scsj.b_app.view.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.wealth.scsj.b_app.R;
import com.wealth.scsj.b_app.adapter.ChooseShopListAdapter;
import com.wealth.scsj.b_app.bean.ShopChooseListBean;

import java.util.ArrayList;
import java.util.List;

/**
 * 选择商铺页面
 * @author qxp
 */
public class ChooseShopPageActivity extends BaseActivity {

    private ImageView mBtnBack;
    private TextView mTvTopTittle;
    private RecyclerView mChooseShopRv;
    List<ShopChooseListBean> mShopChooseList =new ArrayList<>();
    ChooseShopListAdapter mAdapter;

    @Override
    protected void createView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_choose_shop_page);
    }

    @Override
    protected void initView() {

        mBtnBack = findViewById(R.id.btn_back);
        mTvTopTittle =  findViewById(R.id.tv_top_tittle);
        mChooseShopRv = findViewById(R.id.choose_shop_rv);
        mChooseShopRv.setLayoutManager(new LinearLayoutManager(
                ChooseShopPageActivity.this, LinearLayoutManager.VERTICAL, false));
        //TODO 分割线 待完善
//        mChooseShopRv.addItemDecoration(new MyItemDecoration(this,1);
    }

    @Override
    protected void initListener() {
        mBtnBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected void initData() {
        mTvTopTittle.setText("选择店铺");

        for(int i =0 ;i <4;i++){
            ShopChooseListBean bean =new ShopChooseListBean();
            bean.setShop_name("商超糖果店"+i);
            bean.setShop_address("地址：郑州市金水区路劲大厦"+i);
            mShopChooseList.add(bean);
        }
        mAdapter=new ChooseShopListAdapter(ChooseShopPageActivity.this,mShopChooseList);

        mChooseShopRv.setAdapter(mAdapter);
    }
}
